package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class reflectDemo8 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method m = cls.getDeclaredMethod("playGame");
        if(m.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod arm = m.getAnnotation(AutoRunMethod.class);
            int value = arm.value();
            System.out.println(value);
        }
    }
}
